package com.lry.basic.algorithm.common;

public class Game7 {


    public static void main(String[] args) {

        int[] ints = new Game7().game7(new int[]{0, 0, 0, 2, 1,1});

        for (int anInt : ints) {
            System.out.print(anInt+" ");
        }
    }

    private int[] game7(int[] v){

        int[] res = new int[v.length];

        int num7 = 0;//喊过的次数
        for (int i : v) {
            num7 += i;
        }

        int index = 0;
        int num = 1;
        while(num7>0){
            if(num%7==0 || (""+num).contains("7")){
                res[index]++;
                num7--;
            }
            num++;
            index++;
            if(index>=v.length){
                index = 0;
            }
        }

        return res;
    }




}
